<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<script type="text/javascript">
	function checkedEquNos() {
		var equNos = "";
		$("#listBody input:checked").each(function(i, a) {
			if (i != $("#listBody input:checked").length - 1) {
				equNos += a.value + ",";
			} else {
				equNos += a.value;
			}

		});
		return equNos;
	}
	function goAdd() {
		var equNos = checkedEquNos();
		var url = "equSwitch_addUI.action";
		if (equNos == "") {
			alertMsg.warn("请选择至少一个节点！");
		} else {
			url += "?equNos=" + equNos;
			$.pdialog.open(url, "addSwitch", "增加考勤时间段", {
				mask : true,
				width : 600,
				height : 300
			});
		}

	}
	function goSee() {
		var equNos = checkedEquNos();
		var url = "equSwitch_switchList.action";
		if (equNos == "") {
			alertMsg.warn("请选择至少一个节点！");
		} else {
			url += "?equNos=" + equNos;
			navTab.openTab("showEquSwitch", url, {
				title : "查看考勤列表",
				fresh : false,
				data : {}
			});

		}

	}
	function goedit() {
	
		var equNo = "";
		equNo = document.getElementById('hiddenCheckEquNo').value;
		if (equNo == "") {
			alertMsg.warn("请选择一项进行修改！");
		} else {
			var url = "equ_findById.action?equNo=";
			url += equNo;
			$.pdialog.open(url, "editEqu", "修改设备信息", {
				mask : true,
				width : 600,
				height : 540
			});
		}

	}
	function addEqu() {
		navTab.openTab("addEqu", "equ_jsp.action", {
			title : "新增设备",
			fresh : false,
			data : {}
		});
	}
	function edithEquNoCheck(equNo) {
		document.getElementById('hiddenCheckEquNo').value = equNo;
	}
	
	function show_equ_list(){
		$("#show_equ", navTab.getCurrentPanel()).attr("action","equ_show.action");
		$("#show_equ", navTab.getCurrentPanel()).attr("onsubmit","return divSearch(this, 'show_equ_list');");
		$("#show_equ_btn",navTab.getCurrentPanel()).click();
		
	}
	
	show_equ_list();
</script>
<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="1" /> 
	<input type="hidden" name="numPerPage" value="${numPerPage}" /> 	
</form>


<div class="pageHeader">
	<form id="show_equ" rel="pagerForm"  onsubmit="return divSearch(this, 'show_equ_list');" action="equ_show.action" method="post">
		<div class="searchBar nowrap">
			<p style="width: 255px;">
				<label>学校名称:</label>
					<input type="text" name="model.sclName" value="${reSclName}" maxlength="20" 
						postField="sclName" 
						suggestFields="sclName" 
						suggestUrl="school_suggest.action" 
						lookupGroup="model"/>
					<a style="float: right;" class="btnLook" href="school_lookup.action?numPerPage=10" lookupGroup="model">查找学校</a>
			</p>
			<p>
				<label>设备类型：</label>
				<select name="equ.equType" class="combox">
					<option value="">--请选择--</option>
					<option value="0" ${equ.equType eq "0" ? "selected":"" }>考勤设备</option>
					<option value="1" ${equ.equType eq "1" ? "selected":"" }>亲情电话</option>
				</select>
			</p>
			<p>
				<label>设备编号：</label>
				<input type="text" name="equ.equNo" value="${equ.equNo == 0 ? '' : equ.equNo }"/>
			</p>
			<div class="subBar">
				<input type="hidden" id="hiddenCheckEquNo">
				<ul>
					<li style="display: none;">
					<div class="buttonActive"><div class="buttonContent"><button id="show_equ_btn" type="submit">检索</button></div></div>
					</li>
					<li>
					<a class="button" href="javascript:void(0)"  
									onclick="show_equ_list()"><span>检索</span></a>
					</li>
				</ul>
			</div>
		</div>
					
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="javascript:void(0);" onclick="addEqu();"><span>新增</span></a></li>
			<li class="line">line</li>
			<%--
			<li><a class="delete" href="equ_delete.action"
				target="selectedTodo" rel="equNos" postType="string" title="确定要删除吗?"><span>删除</span></a></li>
			<li class="line">line</li>
			 --%>
			<li><a class="edit" href="javascript:void(0);" onclick="goedit();"><span>修改</span></a></li>
			<li class="line">line</li>
			<a class="look" href="javascript:void(0);" onclick="goSee();"><span>查看考勤时间段</span></a>
			</li>
			<li class="line">line</li>
			<li><a class="add" href="javascript:void(0);" onclick="goAdd();"><span>新增考勤时间段</span></a></li>
			<li class="line">line</li>
		</ul>
		<!-- <input id="equipmentNos" type="hidden"> -->
	</div>
	<div id="show_equ_list"></div>
</div>